import { IsString, IsDate, IsEnum, IsNotEmpty } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreateSemesterDto {
    @ApiProperty({ description: '学期名称', example: '2023-2024学年第二学期' })
    @IsString()
    @IsNotEmpty()
    name: string;

    @ApiProperty({ description: '开始日期', example: '2024-02-26' })
    @IsDate()
    @IsNotEmpty()
    startDate: Date;

    @ApiProperty({ description: '结束日期', example: '2024-07-15' })
    @IsDate()
    @IsNotEmpty()
    end_date: Date;

    @ApiProperty({ 
        description: '学期状态', 
        enum: ['planned', 'current', 'completed'],
        example: 'current'
    })
    @IsEnum(['planned', 'current', 'completed'])
    @IsNotEmpty()
    status: string;
}